<!--
 * @Descripttion: 
 * @version: 1.0
 * @Author: LiYansheng
 * @Date: 2022-04-11 13:19:18
 * @LastEditors: CoderXZ
 * @LastEditTime: 2022-04-12 14:11:36
-->
<template>
  <div class="container">
    <el-form :model="term">
      <el-row justify="center" type="flex">
        <el-col :span="6">
          <el-form-item label="ID:" label-width="70px">
            <el-input v-model="term.name" placeholder="" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="角色名:" label-width="70px">
            <el-input v-model="term.name" placeholder="" clearable></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="5" offset="2">
          <el-button type="primary">查询</el-button>
          <el-divider direction="vertical"></el-divider>
          <el-button type="primary">新增</el-button>
        </el-col>
      </el-row>
    </el-form>
    <el-table :data="roles" border>
      <el-table-column label="id" prop="id" align="center"></el-table-column>
      <el-table-column label="角色名" prop="name" align="center"></el-table-column>
      <el-table-column
        label="角色描述"
        prop="depression"
        align="center"
      ></el-table-column>
      <el-table-column
        label="该角色下人数"
        prop="depression"
        align="center"
      ></el-table-column>
      <el-table-column label="可用状态" prop="status" align="center">
        <template slot-scope="scope">
          <el-switch v-model="scope.row.status" active-color="green"></el-switch>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center">
        <el-button type="primary" plain>编辑</el-button>
        <el-button type="danger" plain>删除</el-button>
      </el-table-column>
    </el-table>
    <el-row type="flex" justify="center">
      <el-col :span="12">
        <el-pagination background layout="total,prev, pager, next" :total="1000">
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      term: {
        name: "",
      },
      roles: [
        {
          id: 1,
          name: "管理员",
          depression: "",
          status: true,
        },
        {
          id: 2,
          name: "教师",
          depression: "!!",
          status: false,
        },
        {
          id: 1,
          name: "学生",
          depression: "",
          status: false,
        },
      ],
    };
  },
};
</script>

<style>
.el-pagination {
  margin-top: 15px;
}
</style>
